
package com.yimixian.app.model;

import java.util.List;

public class Order {

    public int id;
    public int status;//订单是否有效
    public List<PaymentMethods> paymentMethods;//"订单可用的支付方式
    public String paymentId;//支付ID
    public boolean isFinished;//订单是否已完成，用于决定高亮
    public boolean needsPayment;//是否需要支付
    public String paymentDueAt;//支付到期时间
    public String complainUrl;//投诉地址
    public String priceToPay;//展示需要支付的价格
    public List<Metadata> priceComponents;//价格组成
    public String successUrl;//支付成功的页面
    public DeliveryInfo deliveryInfo;//订单状态字典

    //新加字段
    public String totalPrice;//￥22.0","展示商品总价",
    public String orderStatus;//"配送中","订单状态字符串",
    public String deliveryVerifyCode;// "22345","收货码",
    public String createdAt;// "YYYY-MM-dd HH:mm","订单创建日期",
    public String receiverName;// "郭靖","收货人姓名",
    public int totalCount;// "20","果品的总量",

    public List<Metadata> metadata;//订单元信息, 去掉了 raw_name, raw_value, 只用于展示
    public List<GoodsItem> items;//所有的果品信息
    public List<FreeItem> freeItems;//所有的赠品信息
    public List<orderStatus> statusItems;//所有的赠品信息

    public String statusUrl; // 废弃
    public String commentBtnName;//评论按钮名字
    public String complainBtnName;//评论按钮名字
    public String commentUrl;// 评论链接地址
    public int indexPage=0;
    public String shareImgUrl="";
    public String shareUrl="";
    public String shareTitle="";
    public String shareIcon="";
    public String shareContent="";

    //2.3.0
    public List<GoodImage> goodImages;
    public SpeedOrder speedOrder;
    public CancelOrder cancelOrder;

    public static class DeliveryInfo {
        public List<String> statuses;
        public int index;
    }

    public static class FreeItem {
        public final String name;
        public final int count;

        public FreeItem(
                int count,
                String name) {
            this.count = count;
            this.name = name;
        }
    }

    public static class orderStatus{
        public String name;
        public String desc;
        public String date;
        public String url;        
        public boolean active;
        public orderStatus(){
            
        }
        public orderStatus(String name,String desc,String date,boolean active,String url){
            this.name=name;
            this.desc=desc;
            this.date=date;
            this.active=active;
            this.url=url;
        }
        
    }
    
    /**
     * 订单可用的支付方式
     */
    public static class PaymentMethods {
        /**
         * id : WECHAT name : 微信支付（推荐）
         */
        private String id;
        private String name;

        public PaymentMethods() {
        }
        public PaymentMethods(String id, String name) {
            this.id = id;
            this.name = name;
        }

        public void setId(String id) {
            this.id = id;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getId() {
            return id;
        }

        public String getName() {
            return name;
        }
    }

}
